const CACHE_NAME = "genshin-data";
const UI_TRANS = "ui-trans";
const BEGIN_DATE = "begin-date";
const MAX_VALUE = "max-value";
const INFO_DISPLAY = "info-display";

let colors = {
    wind: '#3fd998',
    fire: '#ff3b00',
    mine: '#d87aef',
    gress: '#a2f53e',
    rock: '#e7c315',
    ice: '#65e5ea',
    water: '#2bafee',
    default: '#dbdbdb',
    default2: '#a8a8a8',
};

option = {
    tooltip: {
        axisPointer: {
            type: 'cross',
            label: {
                backgroundColor: '#6a7985'
            }
        }
    },
    textStyle: {
        fontFamily: 'genshin',
    },
    xAxis: {
        type: 'time',
        min: '2020-09-15',
        max: '2021-10-15',
        name: '时间轴',
        splitNumber: 12
    },
    yAxis: {
        name:'原石',
        type: 'value',
        max: 28800,
        min: 0,
        splitLine: { //网格线
            show: false
        },
        axisTick:{       //y轴刻度线
            show:true
        },
        axisLine:{       //y轴
            show:true
        },
    },
    dataZoom: [
        {
            type: 'slider',
            xAxisIndex: 0,
            filterMode: 'empty'
        },
        {
            type: 'inside',
            xAxisIndex: 0,
            filterMode: 'empty'
        }
    ],
    series: [
        {
            type: 'line',
            smooth: true,
            symbol: 'none',
            data: [[0,0]],
            areaStyle: {
                color: '#c3cee0'
            },
            markPoint: {
                itemStyle: {opacity: 1},
                data: [
                    {name: "刻晴", xAxis: '2020-11-02 23:50', yAxis: 0},
                    {name: "公子", xAxis: '2020-11-11 15:00', yAxis: 0},
                    {name: "阿贝多", xAxis: '2020-12-23 15:00', yAxis: 0},
                    {name: "迪卢克", xAxis: '2021-01-04', yAxis: 0},
                    {name: "魈", xAxis: '2021-02-03 20:00', yAxis: 0},
                ],
                label: {
                    formatter: '{b}'
                }
            },
            markLine: {
                symbol: "none",
                lineStyle: {
                    type: "dotted",
                    color: "#ccc",
                    width: 1,
                },
                data: [{
                    lineStyle: {
                        color: "#e68af6",
                        width: 2,
                    },
                    label: {
                        color: "#e68af6",
                        position: 'end',
                        formatter: "极限小保底(90x)"
                    },
                    yAxis: 90 * 160

                }, {
                    lineStyle: {
                        color: "#e68af6",
                        width: 1,
                    },
                    label: {
                        color: "#e68af6",
                        position: 'end',
                        formatter: "小保底(80x)"
                    },
                    yAxis: 80 * 160

                },
                    {
                        lineStyle: {
                            type: "dotted",
                            color: "#ffc32b",
                            width: 2,
                        },
                        label: {
                            position: 'end',
                            color: '#ffc32b',
                            formatter: "极限大保底(180x)"
                        },
                        yAxis: 180 * 160

                    },
                    {
                        lineStyle: {
                            type: "dotted",
                            color: "#ffc32b",
                            width: 2,
                        },
                        label: {
                            position: 'end',
                            color: '#ffc32b',
                            formatter: "2x极限大保底(360x)"
                        },
                        yAxis: 360 * 160

                    },
                    {
                        lineStyle: {
                            type: "dotted",
                            color: "#ffc32b",
                            width: 2,
                        },
                        label: {
                            position: 'end',
                            color: '#ffc32b',
                            formatter: "3x极限大保底(540x)"
                        },
                        yAxis: 540 * 160

                    },
                    {
                        lineStyle: {
                            type: "dotted",
                            color: "#ffc32b",
                            width: 1,
                        },
                        label: {
                            position: 'end',
                            color: '#ffc32b',
                            formatter: "大保底(160x)"
                        },
                        yAxis: 160 * 160

                    },
                    {
                        lineStyle: {
                            type: "dotted",
                            color: "#ffc32b",
                            width: 1,
                        },
                        label: {
                            position: 'end',
                            color: '#ffc32b',
                            formatter: "2x大保底(320x)"
                        },
                        yAxis: 320 * 160

                    },
                    {
                        lineStyle: {
                            type: "dotted",
                            color: "#ffc32b",
                            width: 1,
                        },
                        label: {
                            position: 'end',
                            color: '#ffc32b',
                            formatter: "3x大保底(480x)"
                        },
                        yAxis: 480 * 160

                    },

                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.wind,
                            formatter: "[1.0]\n9-28\n\n温迪",
                        },
                        xAxis: '2020-09-28'
                    },
                    {
                        label: {
                            color: colors.fire,
                            formatter: "10-20\n\n可莉"
                        },
                        xAxis: '2020-10-20'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.water,
                            formatter: "[1.1]\n11-11\n\n公子"
                        },
                        xAxis: '2020-11-11'
                    },
                    {
                        label: {
                            color: colors.rock,
                            formatter: "12-1\n\n钟离"
                        },
                        xAxis: '2020-12-01'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.rock,
                            formatter: "[1.2]\n12-23\n\n阿贝多"
                        },
                        xAxis: '2020-12-23'
                    },
                    {
                        label: {
                            color: colors.ice,
                            formatter: "1-12\n\n甘雨"
                        },
                        xAxis: '2021-01-12'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.wind,
                            formatter: "[1.3]\n2-3\n\n魈"
                        },
                        xAxis: '2021-02-03'
                    },
                    {
                        label: {
                            color: colors.mine,
                            formatter: "2-17\n\n刻晴"
                        },
                        xAxis: '2021-02-17'
                    },
                    {
                        label: {
                            color: colors.fire,
                            formatter: "3-2\n\n胡桃"
                        },
                        xAxis: '2021-03-02'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.wind,
                            formatter: "[1.4]\n3-17\n\n温迪"
                        },
                        xAxis: '2021-03-17'
                    },
                    {
                        label: {
                            color: colors.water,
                            formatter: "4-7\n\n公子"
                        },
                        xAxis: '2021-04-07'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.default2,
                            formatter: "[1.5]\n4-28\neula/烟绯\n/钟离?"
                        },
                        xAxis: '2021-04-28'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.default2,
                            formatter: "[1.6]\n6-9\n\n可莉?"
                        },
                        xAxis: '2021-06-09'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.default2,
                            formatter: "[1.7]\n7-21\n\n白术?"
                        },
                        xAxis: '2021-07-21'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.default2,
                            formatter: "[1.8]\n9-1\n\n???"
                        },
                        xAxis: '2021-09-01'
                    },
                    {
                        lineStyle: {
                            color: colors.default,
                            width: 2,
                        },
                        label: {
                            color: colors.default2,
                            formatter: "[2.0]\n10-1\n\n神里?"
                        },
                        xAxis: '2021-10-01'
                    },
                ]
            }
        },
        {
            type: 'line',
            smooth: false,
            data: [],
            symbol: 'none',
            itemStyle:{
                normal:{
                    lineStyle:{
                        color: '#829de3',//注意这样颜色设置的位置
                        width:3,//设置线条宽度
                        type:'dotted'  //设置线条显示：'dotted'虚线 'solid'实线
                    }
                }
            },
        },
        {
            name : "当前原石",
            type : 'effectScatter',
            coordinateSystem : 'cartesian2d',//2d坐标系
            data : [['2021-03-17 11:24:56',16710]],
            symbolOffset : [ 0, 0 ],
            symbolSize : 7,
            large : true,
            symbol : 'circle', //图形 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
            legendHoverLink : true, //是否启用图例 hover 时的联动高亮。
            hoverAnimation : true, //是否开启鼠标 hover 的提示动画效果。
            effectType : 'ripple', //特效类型，目前只支持涟漪特效'ripple'。
            showEffectOn : 'render', //配置何时显示特效。可选：'render' 绘制完成后显示特效。'emphasis' 高亮（hover）的时候显示特效。

            cursor : 'pointer',
            rippleEffect : { //涟漪特效相关配置。
                period : 8, //动画的时间。
                scale : 18, //动画中波纹的最大缩放比例。
                brushType : 'stroke', //波纹的绘制方式，可选 'stroke' 和 'fill'。
            },
            hoverAnimation : true,
            itemStyle : {
                normal : {
                    color : '#3464e0',
                    shadowBlur : 10,
                    shadowColor : '#333'
                }
            },
            zlevel : 1
        }
    ]
};
